/**
 * @file tablewidget.h
 * @brief TableWidget class definition
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3 of the License.
 *
 * @author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
 * @date 13 Jul 2010
 */
#ifndef MJN_TABLEWIDGET_H
#define MJN_TABLEWIDGET_H

#include <GL/gl.h>

#include <QtOpenGL/QGLWidget>
#include "objloader.h"

namespace mjn {

class TableWidget: public QGLWidget
{
    Q_OBJECT
    public:
        explicit TableWidget(QWidget *parent = 0);
        virtual ~TableWidget() {}
    protected:
        void initializeGL();
        void resizeGL(int width, int height);
        void paintGL();
    private:
        double mProectionAngle;
        double mNearPlaneDist;
        double mFarPlaneDist;

        double mCameraPos[3];
        double mCenterPos[3];
        double mUpDirection[3];

        GLfloat mAmbientLight[4];

        GLfloat mLight0Pos[4];
        GLfloat mLight0Dir[3];
        GLfloat mLight0SpotAngle;

        ObjLoader mLoader;
};

}

#endif // MJN_TABLEWIDGET_H
